<template>
  <div class="nav-header">
    <i
      class="menu-icon"
      :class="isFold ? 'el-icon-s-fold' : 'el-icon-s-unfold'"
      @click="handleFoldClick"
    ></i>
    <div class="content">
      <nav-breadcrumb></nav-breadcrumb>
      <nav-info></nav-info>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref, reactive } from "vue";
import NavBreadcrumb from "@/base-ui/breadcrumb";
import NavInfo from "./nav-info.vue";
export default defineComponent({
  emits: ["isFoldChange"],
  components: {
    NavInfo,
    NavBreadcrumb,
  },
  setup(props, { emit }) {
    const isFold = ref(true);
    const handleFoldClick = () => {
      isFold.value = !isFold.value;
      emit("isFoldChange", isFold.value);
    };
    return {
      isFold,
      handleFoldClick,
    };
  },
});
</script>

<style lang="less" scoped>
.nav-header {
  display: flex;
  align-items: center;
  flex: 1;

  .menu-icon {
    font-size: 28px;
    cursor: pointer;
  }

  .content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    padding: 0 18px;
  }
}
</style>
